package com.xw.lora.config;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import com.baomidou.mybatisplus.extension.plugins.PerformanceInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @ClassName MapperConfig
 * @Author liu zhiyong
 * @Date 2020/8/27 10:51
 * @Version 1.0
 */
@Configuration
@MapperScan("com/xw/lora/mapper")//设置mapper接口的扫描包
public class MybatisPlusConfig {
    
    /**
     * mybatis-plus分页插件
     * @Author liu zhiyong
     * @Date 2020/8/28 9:54
     * @param
     * @return com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor 
     **/
//    @Bean
//    public PaginationInterceptor paginationInterceptor(){
//        return new PaginationInterceptor();
//    }

    /**
     * SQL 执行性能分析，开发环境使用，线上不推荐。
     * format SQL是否格式化 默认false
     * maxTime 指的是 sql 最大执行时长
     * @Author liu zhiyong
     * @Date 2020/8/31 9:23
     * @param
     * @return com.baomidou.mybatisplus.extension.plugins.PerformanceInterceptor
     **/
//    @Bean
//    public PerformanceInterceptor performanceInterceptor(){
//        PerformanceInterceptor performanceInterceptor = new PerformanceInterceptor();
//        performanceInterceptor.setFormat(true);//SQL格式化（输出控制台）
//        return performanceInterceptor;
//    }
}
